<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box
    }
    body {
      font-size: 14px;
      padding: 20px;
    }
    ul li {
      line-height: 30px;
    }
  </style>
</head>
<body>
  <ul>
    <li></li>
  </ul>
</body>
<script>
  function showName() {
    return this.name.toUpperCase();
  }
  function speak() {
    let  greeting = 'i am ' + showName.call(this);
    return greeting
  }
  var me = {
    name: 'zhangli'
  }
  console.log(showName.call(me));
  console.log(speak.call(me));
  var a = 123;
  function foo() {
    var a = 456;
    function bar() {
      return window.a
    }
    return bar();
  }
  console.log(foo())
  var obj1 = {
    name: 'zhangli'
  }
  var obj2 ={
    age: '23',
    ...obj1
  }
  console.log(obj2.name)
  console.dir(Object)
  console.dir(Object.prototype)
</script>
</html>